package by.ins.life.evolution;

import java.util.List;

import org.apache.log4j.Logger;

/**
 * Represent all tests goals for one Nuclear Set
 */
public class TestGoalsProviders<T> {
	private static final Logger log = Logger.getLogger(TestGoalsProviders.class);

	private List<ITestGoalsProvider<T>> providers;

	public List<ITestGoalsProvider<T>> getProviders() {
		return providers;
	}

	public void setProviders(List<ITestGoalsProvider<T>> providers) {
		this.providers = providers;
	}

	public ITestGoalsProvider<T> getProviderByName(String providerName) {

		for (ITestGoalsProvider<T> provider : providers) {

			if (provider.equals(provider.getProviderName())) {
				return provider;
			}
		}
		throw new IllegalStateException("Test goals provider does not exist with name :" + providerName);
	}
}
